


(in-package :gen-res)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; list of suitable (types of) subjects:
(defparameter *the-subject-list* 
  (list 'mile-stone 
        'slip 
        'actor 
        'action-item
        'agenda-item
        'meeting 
        'pokemon 
        'risk 
        'defect 
        'gate 
        'project-phase 
        'review
        'product-release
        'feature)
  )


(defparameter *the-property-list*
  (list 'id 
        'name 
        'owner 
        'date 
        'comment 
        'priority 
        'line-item 
        'predecessor 
        'applies-to
        'new-date
        'link
        'supports
        'phone-number 
        'visibility 
        'likelihood 
        'severity 
        'criticality 
        'drama-index 
        'rpn 
        'value
        'branches-to
        'merges-to
        'concurrent-with)
  )

(defparameter *the-subclass-list*
  (list 
   (list 'product-release 'mile-stone)
   (list 'gate 'mile-stone)
   (list 'branches-to 'predecessor)
   (list 'merges-to 'predecessor)
   (list 'concurrent-with 'predecessor)
)  )


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(defparameter pma 
  (list 'res 'actor 'id 9523343728 'name "pma")
  )

(defparameter kent-adams
  (list 'res 'actor 'id 5079931086 'name "Kent Adams")
  )

(defparameter cel (list 'res 'actor 'name "Celtrak"))

(defparameter ian-gallivan (list 'res 'actor 'name "Ian Gallivan"))


(defparameter ulrich-fink
  (list 'res 'actor 'id 6128395186 'name "Ulrich Fink")
  )

(defparameter ed-tan
  (list 'res 'actor 'id 6128179385 'name "Ed Tan")
  )


(defparameter *actors*
  (list
   pma
   kent-adams
   cel
   ulrich-fink
   ed-tan
   )
  )

(defparameter *to-do* 
  (list 
   (list 'res 'action-item 'name "specs" 'owner pma)
   (list 'res 'action-item 'name "containment for phase 0.5" 'owner pma)
   (list 'res 'action-item 'name "where is my gdt normalization a3?"
         'owner pma)
   (list 'res 'action-item 'name "gtdsd" 'owner pma 'date "2010-10-01")
   (list 'res 'action-item 'name "doc id creation" 'owner pma)
))



(defparameter *some-actors* 
  (list
   (list 'res 'actor 'name "Damien Murphy" 'employer cel)
   (list 'res 'actor 'name "Ian Gallivan" 'employer cel)
))


(defparameter hmi-meeting   (list 'res 'meeting 'name "HMI"))

(defparameter *meetings*
  (list
   hmi-meeting
   ))

(defparameter *agenda-items*
  (list
   (list 'res 'agenda-item "HMI Memory Increase" 'applies-to hmi-meeting 'date "2010-10-05")
   (list 'res 'agenda-item "HMI to HMI flash testing" 'applies-to hmi-meeting 'date "2010-10-05")
   ))
   




(defparameter *mile-stones* 
  (list 
   (list 'res 'mile-stone 'name "d005-code-complete" 'date "2010-12-02" 'owner pma)
   (list 'res 'mile-stone 'name "d005-code-freeze" 'date "2010-12-15")
   (list 'res 'mile-stone 'name "d005-svpp" 'date "2011-01-20")
   (list 'res 'mile-stone 'name "d005-pr-ship" 'date "2011-02-02")
   (list 'res 'mile-stone 'name "d010-specs-complete" 'date "2010-12-15")
   (list 'res 'mile-stone 'name "d010-code-complete" 'date "2011-01-27")
   (list 'res 'mile-stone 'name "os+ over CAN" 'date "2011-01-27")
   (list 'res 'mile-stone 'name "d020-specs-complete" 'date "2011-03-23")
   (list 'res 'mile-stone 'name "dry-run" 'date "2010-10-11")
   (list 'res 'mile-stone 'name "dry-run" 'date "2010-10-11")
   ))



(defparameter *action-items* 
  (list
   (list 'res 'action-item 'name "local deferral" 'owner pma )
   (list 'res 'action-item 'name "updates ram or persistent?" 'owner pma )
   (list 'res 'action-item 'name "assign spec resource" 'owner ulrich-fink)
   (list 'res 'action-item 'name "specify phases for the different cel SRS" 'owner ed-tan)
   (list 'res 'action-item 'name "Get Doors Running at CEL" 'owner ian-gallivan)
   
   ))

(defparameter *current-build-numbers*
  (list
   (list 'res 'mile-stone 'name "Current HMI Build Number" 'date "2010-09-27" 'value 191 'version 9220 'release 6560)
   (list 'res 'mile-stone 'name "Current HMI Build Number" 'date "2010-10-01" 'value 191 'version 9220 'release 6560)
   (list 'res 'mile-stone 'name "Current SR3 Build Number" 'date "2010-09-28" 'value 83)
   )
  )

(defmacro set-ms (n &rest body)
  `(defparameter ,n (list 'res 'mile-stone 'name (string (quote ,n)) ,@body)))


(set-ms HMI-6560-load-1 'date "2010-10-01" )
(set-ms HMI-6560-load-2 'date "2010-10-25" 'predecessor HMI-6560-load-1)
(set-ms HMI-6560-load-3 'date "2010-11-22" 'predecessor HMI-6560-load-2)
(set-ms HMI-6560-code-complete 'date "2011-11-22" 'concurrent-with HMI-6560-load-3)
(set-ms HMI-6560-code-freeze 'date "2011-01-20" 'predecessor HMI-6560-code-complete )
(set-ms HMI-6560-internal-release 'date "2011-01-20" 'predecessor HMI-6560-code-freeze )

(set-ms D005-load-1 'date "2010-10-01")

(defparameter flashload-usb-from-ufd
  (list 'res 'features 'name "Flashload USB From UFD"))

(set-ms D005-load-1.5 'date "2010-10-19" 'predecessor D005-load-1 'supports  flashload-usb-from-ufd)

(set-ms D005-load-2 'date "2010-10-19" 'predecessor D005-load-1 'predecessor D005-load-1.5)

(defparameter slip-alpha
  (list 'res 'slip 
        'name "Adding intermediate load" 
        'date "2010-10-05" 
        'applies-to D005-load-2 
        'new-date "2010-11-02"
        'link "http://extranet-sharepoint.ingerrand.com/cctech/sr2controlsys/D000%20Project%20Docs/FW%20Actions%20from%20TKWatlow%20meeting%20today.htm"
        ))

(set-ms D005-load-3 'date "2010-12-02" 'predecessor D005-load-2)

(defparameter slip-beta
  (list 'res 'slip 
        'name "Help with launch date" 
        'date "2010-10-05" 
        'applies-to D005-load-3 
        'new-date "2010-11-23"
        'comment "requires deferring authorization"
        'link "http://extranet-sharepoint.ingerrand.com/cctech/sr2controlsys/D000%20Project%20Docs/FW%20Actions%20from%20TKWatlow%20meeting%20today.htm"
        ))

(set-ms D005-code-complete 'date "2011-01-20" 'concurrent-with D005-load-3)
(set-ms D005-code-freeze 'date "2011-01-20" 'predecessor D005-code-complete )
(set-ms D005-internal-release 'date "2011-01-20" 'predecessor D005-code-freeze )


(set-ms phase-zero-point-five 'date "2011-01-20" 'concurrent-with D005-internal-release 'concurrent-with HMI-6560-internal-release )



(defparameter *roadmap*
  (list 
   (list 'res 'mile-stone 'name "ICON ST Branch")
   (list 'res 'mile-stone 'name "ICON MT Branch")
   (list 'res 'mile-stone 'name "SR3 ST Branch")
   (list 'res 'mile-stone 'name "SR3 MT Branch")
   (list 'res 'mile-stone 'name "Rail Branch")
   (list 'res 'mile-stone 'name "B050")
   (list 'res 'mile-stone 'name "B051")
   (list 'res 'mile-stone 'name "D000")
   

HMI-6560-load-1 
HMI-6560-load-2 
HMI-6560-load-3 
HMI-6560-code-complete 
HMI-6560-code-freeze 
HMI-6560-internal-release 

D005-load-1 
   D005-load-1.5 
   D005-load-2
D005-load-3 
D005-code-complete 
D005-code-freeze
   D005-internal-release 
   
   (list 'res 'mile-stone 'name "D010")
   (list 'res 'mile-stone 'name "D020")
   (list 'res 'mile-stone 'name "6550")
   (list 'res 'mile-stone 'name "6552" 'comment "stirling")
   (list 'res 'mile-stone 'name "6553" 'comment "i-box")
   (list 'res 'mile-stone 'name "6560")
   
   
   ))

(defparameter *slips*
    (list slip-alpha
          slip-beta
          ))

(defparameter *features* 
    (list flashload-usb-from-ufd
          ))



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defparameter *everything*
  (list *actors*
        *action-items* 
        
        *mile-stones* 
        *current-build-numbers*
        *roadmap*
        *slips*
        
        *features*
        *meetings*
        *agenda-items*
        )
  )


(defun commit-universe ()
  
  ( commit-resources-from-list *the-subject-list* )
  ( commit-properties-from-list *the-property-list*) 
  ( commit-subclases-from-list *the-subclass-list* )
  (mapcar #'commit-all-resources-as-list *everything*)
  (db.agraph.user::index-all-triples)
  )

(defun commit-named-universe (the-triplestore-name)
  
  ; (setf db.agraph.user::*default-pathname-defaults* "C:\\allegro-rep")
 
  (db.agraph.user::create-triple-store the-triplestore-name  :if-exists :supersede)  
      
  (gen-res::commit-universe)
  
  (db.agraph.user::triple-count)
      
  )

(defun cnu () 
  (let (
        ( x 0)
        )
  ( commit-named-universe "rdf-05")
  (setq x   (db.agraph.user::triple-count) )
    (db.agraph.user::close-triple-store)
    x
  ))
  


        
        
        
        









